// vote, 3 person,['Ann','Ben','Cat'],
// 10 times vote to 3 person.
// get total of vote.
// output the vote result.
#include <stdio.h>
#include <string.h>

int main(void)
{
    typedef struct vote
    {
        char name[20];
        int count;
    } Vote;

    Vote person[3] = 
    {
        {"Ann",0},
        {"Ben",0},
        {"Cat",0},
    };
    int i,j;
    char tmp[20] = {'\0'};
    printf("Enter vote name in ['Ann','Ben' and 'Cat']:\n");
    for(i = 0; i < 10; i++)
    {
        scanf("%s",tmp);
        for(j = 0; j < 3; j++)
        {
            if(strcmp(person[j].name,tmp) == 0)
            {
                person[j].count++;
            }    
        }
    }
        
    for(i = 0; i < 3; i++)
    {
        printf("%s %d\n",person[i].name,person[i].count);
    }    
    //sortvote(person);
	printf("hello world你好\n");
	return 0;
}